package com.qf.rbac2202.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class PageVo<T> {

    private Long totalCount;

    private Long pageSize;

    private Long totalPage;

    private Long currPage;

    private List<T> list;


    public PageVo(Page<T> page) {

        this.totalCount = page.getTotal();

        this.pageSize = page.getSize();

        this.totalPage = page.getPages();

        this.currPage = page.getCurrent();

        this.list = page.getRecords();
    }
}
